<?php $this->headScript()->appendFile($this->JS_PATH . 'form_deal.js'); ?>
<link rel="stylesheet" href="<?php echo $this->CSS_PATH ?>main.css">
<div id="deal-listing"></div>
<div class="content">
    <div class="page-title"> <i class="icon-custom-right"></i>
        <h3><span class="semi-bold"><?php echo $this->mode;?> Deal</span></h3>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="grid simple">
                <div class="grid-title"></div>
                <div class="grid-body ">
                    <div class="row">
						<?php if (count($this->errorMessageArray) > 0): ?>
                            <div class="alert alert-error">
                                <?php foreach ($this->errorMessageArray as $erroValue): ?>
                                    <div class="text-left">
                                        <i class="icon-remove-sign"></i>
                                        <?php echo $erroValue; ?>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

						<form role="form"  id="deal-form" name="deal-form"  enctype="multipart/form-data"  action="" method="post">
						   
							<div class="row form-row">
								<div class="col-md-3">
									<label class="form-label">Deal Name
										<span class="span_required">*</span>
									</label>
									<?php echo $this->form->deal_name; ?>
								</div>
							
								<div class="col-md-3">
									<label class="form-label">Deal Stage
										<span class="span_required">*</span>
									</label>
									<?php echo $this->form->deal_stage; ?>
								</div>
								
								<div class="col-md-3">
									<label class="form-label">Deal Currency</label>
									<?php echo $this->form->deal_currency; ?>
								</div>
							</div> 
							
							<div class="row form-row">
								<div class="col-md-3">
									<label class="form-label">Deal Income</label>
									<?php echo $this->form->deal_income; ?>
								</div>
							
								<div class="col-md-3">
									<label class="form-label">Deal Probability</label>
									<?php echo $this->form->deal_probability; ?>
								</div>
							
								<div class="col-md-3">
									<label class="form-label">Deal type
										<span class="span_required">*</span>
									</label>
									<?php echo $this->form->deal_type ; ?>
								</div>
							</div>
							
							<div class="row form-row">
								<div class="col-md-3">
									<label class="form-label">Start Date</label>
									<div class="input-append success date ">
										<?php echo $this->form->deal_startdate; ?>
										<span class="add-on"><span class="arrow"></span><i class="fa fa-th"></i></span>
									</div>
								</div>
							
								<div class="col-md-3">
									<label class="form-label">End Date</label>
									<div class="input-append success date ">
										<?php echo $this->form->deal_enddate; ?>
										<span class="add-on"><span class="arrow"></span><i class="fa fa-th"></i></span>
									</div>
								</div>
							
								<div class="col-md-3">
									<br/>
									<?php 
										$checked = "";
										if ($this->deal_available_to_everyone == 1) {
										  $checked = "checked";
										} 
									?>
									<label>
										<input type="checkbox" name="deal_available_to_everyone" <?php echo $checked;?> value="1">&nbsp; Deal available to everyone
									</label>
								</div>
							</div>
							
							<div class="row form-row">
								<div class="col-md-3">
									<label class="form-label">Comment</label>
									<?php echo $this->form->deal_comment; ?>
								</div>
							
								<div class="col-md-3">
									<label class="form-label">Client Name
										<span class="span_required">*</span>
									</label>
									<?php echo $this->form->deal_clnt_id; ?>
									<button id="add_client" class="btn btn-success" data-toggle="modal"> Add Client </button>
								</div>
								
								<div class="col-md-3">
									<label class="form-label">Status
										<span class="span_required">*</span>
									</label>
									<?php echo $this->form->deal_status; ?>
								</div>
							</div>
								 
							<div class="col-md-6">
								<?php if ($this->mode == 'Edit'): ?>
									<input type="submit" value="Update" class="submitfrmbtn btn btn-primary" name="Update"/>
								<?php else: ?>
									<input type="submit" value="Submit" class="submitfrmbtn   btn btn-primary" name="Submit"/>
								<?php endif; ?>
									<a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'deals', 'action' => 'form'), null, TRUE); ?>" class="btn btn-default"/>
										Cancel
									</a>
							</div>
						</form>
					</div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END PAGE -->                

<!-- Assign to company modal -->
<div class="modal fade" id="myModal_client" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myModalLabel" class="semi-bold">Add Client</h4>
            </div>
            <div class="modal-body">
                <div class="row form-row">
                    <div class="alert alert-error" id="error_add_client" style="display: none">
                        Please select client.
                    </div>
                    <div class="alert alert-success" id="success_add_client" style="display: none">
                        Client add successfully.
                    </div>
				
					<div class="col-md-10">
						<div class="col-md-3">First Name</div>
						<div class="col-md-8">
							<input type="text" name="clnt_first_name" id="clnt_first_name" style="width: 300px;"/>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-3">Middle Name</div>
						<div class="col-md-8">
							<input type="text" name="clnt_middle_name" id="clnt_middle_name" style="width: 300px;"/>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-3">Last Name</div>
						<div class="col-md-8">
							<input type="text" name="clnt_last_name" id="clnt_last_name" style="width: 300px;"/>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-3">Email</div>
						<div class="col-md-8">
							<input type="text" name="clnt_email" id="clnt_email" style="width: 300px;"/>
						</div>
					</div>
					
					<div class="col-md-10">
						<div class="col-md-3">Phone</div>
						<div class="col-md-8">
							<input type="text" name="clnt_phone" id="clnt_phone" style="width: 300px;"/>
						</div>
					</div>
				</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="add_btn_client">Save</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->